package com.sofwin.system.controller;

import com.sofwin.annotation.Log;
import com.sofwin.annotation.OperatorType;
import com.sofwin.common.ResponseEntry;
import com.sofwin.pojo.SysDep;
import com.sofwin.system.service.DeptService;
import com.sofwin.system.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @packageName: com.sofwin.system.controller
 * @user: andyliu
 * @date: 2021/12/16 14:40
 * @email 115176513@qq.com
 * @description: TODO
 */
@Controller
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private DeptService deptService;

    @GetMapping("deptTtree")
    @ResponseBody
    @Log(moduleName = "部门树",operatorType = OperatorType.QUERY)
    public ResponseEntry deptTree(){
        List<SysDep> depts  = deptService.selectAllDep(null);
        return ResponseEntry.success(depts);
    }


}
